//
//  LCPrefix.h
//  LongChain
//
//  Created by FengZi on 2018/3/20.
//  Copyright © 2018年 FengZi. All rights reserved.
//

#ifndef LCPrefix_h
#define LCPrefix_h
//  ======================= ThirdParts ===================
#import <AFNetworking/AFNetworking.h>
#import <Masonry.h>
#import <MJExtension/MJExtension.h>
#import <SDWebImage/UIImageView+WebCache.h>
#import "LCNetwork.h"
#import "LCEncryptionManager.h"
#import "UIViewController+LCHub.h"
#import <MJExtension/MJExtension.h>
#import <MJRefresh.h>
//#define BASEURL @"http://myzexabox.6655.la:8020/zbx"
//#define BASEURL @"http://222.188.110.107:8020/api"
#define BASEURL @"http://222.188.110.100:8020"



#define SWidth  [UIScreen mainScreen].bounds.size.width
#define SHeight [UIScreen mainScreen].bounds.size.height
#define IBANavigationBarHeight CGRectGetHeight(self.navigationController.navigationBar.frame)
#define kDevice_Is_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

#define DeviceUUIDStr [[UIDevice currentDevice] identifierForVendor].UUIDString

#define UserDefault [NSUserDefaults  standardUserDefaults]

#define systemViersion [[[UIDevice currentDevice] systemVersion] floatValue]

#define LocStr(key) NSLocalizedString(key, nil)

#define Bounds [[UIScreen mainScreen] bounds]
#define RGB(r, g, b)   [UIColor colorWithRed:((r) / 255.0) green:((g) / 255.0) blue:((b) / 255.0) alpha:1.0]

#define RGBAlpha(r, g, b, a)     [UIColor colorWithRed:((r) / 255.0) green:((g) / 255.0) blue:((b) / 255.0) alpha:(a)]


#define LC_UNAVAILABLE(msg) __attribute__((unavailable(msg)))

#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;
#define SS(strongSelf) __strong __typeof(weakSelf) strongSelf = weakSelf;

// fprintf(stderr,"\nfunction:%s line:%d content:%s\n", __FUNCTION__, __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
//#define NSLog(format, ...) do {                                                                          \
//fprintf(stderr, "<%s : %d> %s\n",                                           \
//        [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String],  \
//        __LINE__, __func__);                                                        \
//(NSLog)((format), ##__VA_ARGS__);                                           \
//fprintf(stderr, "-------\n");                                               \
//} while (0)

//#ifdef DEBUG
//#define IBALog( s, ... ) NSLog( @"\n%p %@:(Line =  %d) \n %@  \n%s", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__],__FUNCTION__)//分别是方法地址，文件名，在文件的第几行，自定义输出内容
//#else
//#define IBALog( s, ... )
//#endif
#ifdef DEBUG
// 调试时改变NSLog方法，输出时间、方法名、行数、输入的内容
#define LCLog(format, ...) printf("\n[%s] %s [第%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
#else
#define LCLog(format, ...)
#endif

#endif /* LCPrefix_h */
